<#include "/graduation/inc/layout.ftl"/>
<@layout "修改用户信息">

<div class="panel panel-default stacked">
	<div class="panel-heading">
		头像
	</div>
	<div class="panel-body">
		<div id="message">
			<#include "/graduation/inc/action_message.ftl"/>
		</div>
			<div class="update_ava">
				<img src="<@resource src=profile.avatar/>" id="target" alt="[Example]" />
			</div>
			<div class="upload-btn">
				<label>
					<span>点击选择一张图片</span>
					<input id="upload_btn" type="file" name="file" accept="image/*" title="点击添加图片">
				</label>
			</div>
	</div><!-- /panel-content -->
</div><!-- /panel -->

	<div class="panel panel-default stacked">
		<div class="panel-heading">
			邮箱
		</div>
		<div class="panel-body">
			<div class="tab-pane active" id="profile">
				<form id="submitForm" action="email" method="post" class="form-horizontal">
					<div class="form-group">
						<label class="control-label col-lg-3" for="email">邮箱地址</label>
						<div class="col-lg-4">
							<div class="input-group">
								<input type="text" class="form-control" name="email" value="${profile.email}" maxlength="64" required>
								<span class="input-group-btn">
								<button class="btn btn-primary" type="button" id="sendCode">获取验证码</button>
						  	</span>
							</div>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-lg-3">验证码</label>
						<div class="col-lg-4">
							<input type="text" class="form-control" name="code" maxlength="6" required>
						</div>
					</div>
					<div class="form-group">
						<div class="text-center">
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div><!-- /form-actions -->
				</form>
			</div>
		</div><!-- /panel-content -->
	</div><!-- /panel -->

	<div class="panel panel-default stacked">
		<div class="panel-heading">
			密码
		</div>
		<div class="panel-body">
			<div class="tab-pane active" id="passwd">
				<form id="submitForm" action="password" method="post" class="form-horizontal">
					<div class="form-group">
						<label class="control-label col-lg-3" for="password">当前密码</label>
						<div class="col-lg-4">
							<input type="password" class="form-control" name="oldPassword" maxlength="18" placeholder="请输入当前密码" required>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-lg-3" for="password">新密码</label>
						<div class="col-lg-4">
							<input type="password" class="form-control" id="password" name="password" placeholder="请输入新密码" maxlength="18" required>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-lg-3" for="password2">确认密码</label>
						<div class="col-lg-4">
							<input type="password" class="form-control" name="password2" data-required placeholder="请再输入一遍新密码" maxlength="18" required>
						</div>
					</div>
					<div class="form-group">
						<div class="text-center">
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div><!-- /form-actions -->
				</form>
			</div>
		</div><!-- /panel-content -->
	</div><!-- /panel -->

	<div class="panel panel-default stacked">
		<div class="panel-heading">
			基本资料
		</div>
		<div class="panel-body">
			<div class="tab-pane active" id="profile">
				<form id="submitForm" action="profile" method="post" class="form-horizontal">
					<div class="form-group">
						<label class="control-label col-lg-3" for="nickname">昵称</label>
						<div class="col-lg-4">
							<input type="text" class="form-control" name="name" value="${view.name}" maxlength="7" required>
						</div>
					</div>
					<div class="form-group">
						<label class="control-label col-lg-3" for="nickname">个性签名</label>
						<div class="col-lg-6">
							<textarea name="signature" class="form-control" rows="3" maxlength="128">${view.signature}</textarea>
						</div>
					</div>
					<div class="form-group">
						<div class="text-center">
							<button type="submit" class="btn btn-primary">保存</button>
						</div>
					</div><!-- /form-actions -->
				</form>
			</div>
		</div><!-- /panel-content -->
	</div><!-- /panel -->

<script type="text/javascript">
    seajs.use('avatar');
</script>
</@layout>